//part1:C09:ex9.34.cpp
#include <iostream>
#include <vector>
using namespace std;

int main(void) {
  vector<int> vec = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  auto iter = vec.begin();
  string tmp;
  while (iter != vec.end()) {
    if (*iter % 2) {
      iter = vec.insert(iter, *iter);
    }
    ++iter;
    for (auto begin = vec.begin(); begin != vec.end(); begin ++) {
      cout << *begin << " "; 
    }
    cout << endl;
    cin >> tmp;
  }
  
  return 0;
}
